home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9379 < prev    next >
Encoding:
Text File  |  1996-08-05  |  814 b   |  42 lines

  1. Path: news.win.tue.nl!not-for-mail
  2. From: dedos8@wsintt09.win.tue.nl (Arnaud Gouder de Beauregard)
  3. Newsgroups: comp.lang.c++
  4. Subject: Templates problem: I don't get this :(
  5. Date: 1 Mar 1996 14:40:11 +0100
  6. Organization: Eindhoven University of Technology, The Netherlands
  7. Message-ID: <4h6unr$3hu@wsintt09.win.tue.nl>
  8. NNTP-Posting-Host: wsintt09.win.tue.nl
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. I tried to make a Binary Tree with templates, but the following won't
  12. compile: What am I doing wrong ?
  13.  
  14.  
  15.  
  16. template <class T>
  17. class Tree
  18. {
  19.  TreeNode<T> *root;
  20. };
  21.  
  22. template <class T>
  23. class TreeNode
  24. {
  25.   T value;
  26.   Tree<T> left; // Here is ther problem. A pointer IS allowed, but I
  27.         // don't want that.
  28. };
  29.  
  30. int main()
  31. {
  32.   Tree<int> t;
  33.   return 0;
  34. }
  35.  
  36. Greets,
  37.  
  38. Arnaud
  39. -- 
  40. Arnaud Gouder - dedos8@win.tue.nl - chiller@hvision.nl
  41.  
  42.